package com.study.bigwork.teacher.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.study.bigwork.entity.Teacher;
import com.study.bigwork.entity.User;
import com.study.bigwork.teacher.dao.TeacherDao;
import com.study.bigwork.user.dao.UserDao;

@Service
@Transactional(readOnly=false)
public class TeacherService {
	@Resource
	private TeacherDao teacherDao;
	
	public boolean addTeacher(Teacher teacher) {
		return teacherDao.addTeacher(teacher);
	}
	
	public Teacher findTeacherByPhonenumberAndPassword(String pNumber,String password){
		return teacherDao.findTeacherByPhonenumberAndPassword(pNumber, password);
	}
	
	public Teacher findTeacherByPhonenumber(String pNumber){
		return teacherDao.findTeacherByPhonenumber(pNumber);
	}
	
	public Teacher getChatTeacher(String chat_id){
		return teacherDao.getChatTeacher(chat_id);
	}
	public boolean isExistTeacher(String pNumber) {
		return teacherDao.isExistTeacher(pNumber);

	}
	//获取chat信息
	public Teacher getChatInfo(Teacher teacher) {
		return this.teacherDao.getChatInfo(teacher);
	}	
}